package com.dayuanit.dy8.mall.springbootmall.service.impl;

import com.dayuanit.dy8.mall.springbootmall.entity.Area;
import com.dayuanit.dy8.mall.springbootmall.entity.City;
import com.dayuanit.dy8.mall.springbootmall.entity.Province;
import com.dayuanit.dy8.mall.springbootmall.mapper.AreaMapper;
import com.dayuanit.dy8.mall.springbootmall.mapper.CityMapper;
import com.dayuanit.dy8.mall.springbootmall.mapper.ProvinceMapper;
import com.dayuanit.dy8.mall.springbootmall.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressServiceImpl implements AddressService {

    @Autowired
    private ProvinceMapper provinceMapper;

    @Autowired
    private CityMapper cityMapper;

    @Autowired
    private AreaMapper areaMapper;

    @Override
    public List<Province> loadPro() {
        return provinceMapper.listPro();
    }

    @Override
    public List<City> loadCity(String proCode) {
        return cityMapper.listCity(proCode);
    }

    @Override
    public List<Area> loadArea(String cityCode) {
        return areaMapper.listArea(cityCode);
    }
}
